# -*- coding: utf-8 -*-
# @Time    : 2022/1/11 22:29
# @Author  : 徐翊宸
# @Email   : xyc@163.com
# @File    : page_tjyxmb.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class TjyxMbPage(BasePage):

    gengduo_locator = (By.LINK_TEXT, "更多")
    yx_submit_locator = (By.LINK_TEXT, "营销")
    fsyj_locator = (By.LINK_TEXT, "发送邮件")
    shezhi_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div:nth-child(2) > form > div > div:nth-child(2) > p > a:nth-child(4)")
    tjyj_locator = (By.LINK_TEXT, "添加邮件模板")
    mbmc_locator = (By.CSS_SELECTOR, "#dialog-add > form > table > tbody > tr:nth-child(2) > td:nth-child(2) > input")
    yjzt_locator = (By.CSS_SELECTOR, "#dialog-add > form > table > tbody > tr:nth-child(3) > td:nth-child(2) > input")
    yjnr_locator = (By.CSS_SELECTOR, "#content")
    baocun_locator = (By.CSS_SELECTOR, "#dialog-add > form > table > tfoot > tr > td > input.btn.btn-primary")

    def gengduo_click(self):
        self.driver.find_element(*self.gengduo_locator).click()

    def yx_submit_click(self):
        self.driver.find_element(*self.yx_submit_locator).click()

    def fsyj_click(self):
        self.driver.find_element(*self.fsyj_locator).click()

    def sehzhi_click(self):
        self.driver.find_element(*self.shezhi_locator).click()

    def tjyj_click(self):
        self.driver.find_element(*self.tjyj_locator).click()

    def mbmc_input(self, mbmc):
        self.driver.find_element(*self.mbmc_locator).send_keys(mbmc)

    def yjzt_input(self, yjzt):
        self.driver.find_element(*self.yjzt_locator).send_keys(yjzt)

    def yjnr_input(self, yjnr):
        self.driver.find_element(*self.yjnr_locator).send_keys(yjnr)

    def baocun_click(self):
        self.driver.find_element(*self.baocun_locator).click()


